<template>
  <div class="dashboard-editor-container">
    <div class="title">
      <h1>欢迎登录南海佛学院信息管理系统</h1>
    </div>
    <div class="message-content">
      <h3>消息通知<i>1</i></h3>

      <div class="messageLists">
        <div
          class="message-list"
          v-for="(item, index) in messageFlag"
          :key="index"
        >
          <div
            class="message-title"
            @click="messageFlag[index]['flag'] = !messageFlag[index]['flag']"
          >
            <i class="red"></i>
            <i
              :class="[
                messageFlag[index]['flag']
                  ? 'el-icon-arrow-down'
                  : 'el-icon-arrow-right',
              ]"
            ></i>
            <h4>消息标题</h4>
            <time>2022-06-15</time>
          </div>
          <div
            class="message-data"
            :style="messageFlag[index]['flag'] ? '' : 'display: none'"
          >
            消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容消息内容
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "Index",
  components: {},
  data() {
    return {
      messageFlag: [
        { flag: false },
        { flag: false },
        { flag: false },
        { flag: false },
      ],
    };
  },
  methods: {},
};
</script>

<style lang="scss" scoped>
.dashboard-editor-container {
  padding: 32px;
  font-size: 18px;
  // background-color: rgb(240, 242, 245);
  position: relative;
  .title {
    width: 100%;
    text-align: center;
    h1 {
      line-height: 320px;
      font-weight: bold;
      font-size: 32px;
    }
  }
  .chart-wrapper {
    background: #fff;
    padding: 16px 16px 0;
    margin-bottom: 32px;
  }
}
.message-content {
  h3 {
    font-weight: bold;
    padding-left: 20px;
    height: 20px;
    line-height: 20px;

    i {
      display: inline-block;
      width: 18px;
      height: 18px;
      line-height: 18px;
      border-radius: 50%;
      background-color: #ea0808;
      color: #fff;
      text-align: center;
      font-size: 14px;
      margin-left: 10px;
      font-style: normal;
    }
  }

  .messageLists {
    border: 1px solid #ddd;
    padding: 0 20px;
    .message-list {
      .message-title {
        cursor: pointer;
        line-height: 40px;
        font-size: 14px;
        h4 {
          display: inline-block;
          margin: 0 14px;
          font-size: 16px;
          font-weight: bold;
        }
        .red {
          display: inline-block;
          width: 6px;
          height: 6px;
          line-height: 1;
          background-color: #ea0808;
          border-radius: 50%;
          margin-right: 6px;
          margin-bottom: 2px;
        }
      }
      .message-data {
        padding: 0px 0px 6px 10px;
        font-size: 13px;
      }
      &:not(:last-child) {
        border-bottom: 1px solid #dfdfdf;
      }
    }
  }
}

@media (max-width: 1024px) {
  .chart-wrapper {
    padding: 8px;
  }
}
</style>
